<% title @group.name %>
<% page_new new_meeting_path(groupid: @group.id) %>

<div class="group_info">
  <div class="small_margin_bottom">
    <%= raw(@group.description) %>
  </div>

  <div class="notification_wrapper">
    <strong class="tip_notifications_button">
      <i class="fa fa-list small_margin_right"></i>
      <%= t('members', count: @group.group_members.count) %>
    </strong>
    <%= render_group_member_partial(@group) %>
  </div>

  <strong>
    <i class="fa fa-key small_margin_right"></i>
    <%= t('groups.show.led_by') %>
  </strong>

  <%= @group.leaders.map { |leader| leader_link(leader) }.to_sentence.html_safe %>

  <% if user_can_delete? @group %>
    <%= delete_group_link(@group, class: 'align_right') %>
  <% elsif @group.members.include? current_user %>
    <%= leave_group_link(@group, class: 'align_right') %>
  <% else %>
    <%= join_group_link(@group, class: 'align_right') %>
  <% end %>

  <div class="clear"></div>
</div>

<% if @meetings.present? %>
  <div class="spacer"></div>
  <% @meetings.each do |meeting| %>
    <div class="meeting <%= 'no_margin_bottom' if meeting == @meetings.last %>">
      <h1 class="meeting_name">
        <%= link_to meeting.name, meeting_path(meeting) %>
        <%= edit_meeting_link(meeting,
                                  class: 'align_right display_inline_block') %>
      </h1>
      <%= render_meeting_partial(meeting) %>
    </div>
  <% end %>
<% end %>
